#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableGuideStepEnvironmentDao:DaoBase<TableGuideStepEnvironment>
    {
        public override string GetFileName()
        {
            return "TableGuideStepEnvironment.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimary = new Dictionary<string, TableGuideStepEnvironment>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableGuideStepEnvironment model)
        {
            #if UNITY_EDITOR
            if(cachePrimary.ContainsKey(model.EnvPrefabId)) UnityEngine.Debug.LogError("数据表id重复:TableGuideStepEnvironment->id: " + model.EnvPrefabId);
            #endif
            cachePrimary[model.EnvPrefabId] = model;
        }
        protected override TableGuideStepEnvironment ParseRowData(string[] rowData)
        {
            TableGuideStepEnvironment data = new TableGuideStepEnvironment();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.EnvPrefabId = rowData[0];
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.EnvType = rowData[1];
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.Param = rowData[2];
            }
            return data;
        }
    }
}
